import java.util.Scanner;

public class CODESPTB {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);

		// Enter number of testcases
		int testcases = in.nextInt();
		while (testcases-- > 0) {
			// Enter number of elements to be added in an array
			int numElements = in.nextInt();
			int[] numArray = new int[numElements];

			// Enter numbers in array
			for (int i = 0; i < numArray.length; i++) {
				numArray[i] = in.nextInt();
			}
			numberSwaps(numArray);
		}
	}
	private static void numberSwaps(int[] numberArray) {
		int swapCount = 0;
		for (int i = 1; i < numberArray.length; i++) {
			int key = numberArray[i];
			int j = i;
			while ((j > 0)) {
				if (numberArray[j - 1] > key) {
					
				}
				swapCount++;
				j--;
			}
		}
	}
}
